package com.lagou.edu.wwyan.web1.minicat;

public class Service implements LifeCycle{
    private Engine engine;
    private Connector connector;

    public Service(Engine engine, Connector connector) {
        this.engine = engine;
        this.connector = connector;
    }

    public Service() {
    }

    public Engine getEngine() {
        return engine;
    }

    public void setEngine(Engine engine) {
        this.engine = engine;
    }

    public Connector getConnector() {
        return connector;
    }

    public void setConnector(Connector connector) {
        this.connector = connector;
    }

    @Override
    public void init() {
        engine.init();
        connector.init();
    }

    @Override
    public void start() throws Exception {
        engine.start();
        connector.start();
    }
}
